package com.seatademo.orders.controller;

import com.seatademo.orders.entity.OrderTbl;
import com.seatademo.orders.service.IOrderTblService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/orders")
public class OrderController {

    //注入Order业务类

    //controller实现订单保存

    @RequestMapping("/save")
    public boolean save(){
        System.out.println("保存订单成功"+iOrderTblService);
        return true;
    }

    @Autowired
    private IOrderTblService iOrderTblService;

    @RequestMapping("/get")
    public OrderTbl selectOne(){
        System.out.println("====================");
        return iOrderTblService.getById(1);
    }
}
